package jsyf.oa.web.crm;

import com.alibaba.dubbo.common.json.JSONObject;
import io.swagger.annotations.Api;
import jsyf.com.util.BaseUtils;
import jsyf.com.util.ResponseUtils;
import jsyf.oa.facade.crm.EquipmentBrandFacade;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by WHH-PC on 2017/12/30.
 */
@Api(value = "设备品牌接口", description = "设备品牌接口")
@Controller
@RequestMapping("/equipmentBrand")
public class EquipmentBrandController {
    @Resource
    private EquipmentBrandFacade equipmentBrandFacade;

    @RequestMapping(value = "/getBrandList.json", method = RequestMethod.POST)
    public void getBrandList(HttpServletResponse response, @RequestBody String jsonData) {
        com.alibaba.fastjson.JSONObject records = equipmentBrandFacade.getBrandList();
        if (records != null) {
            ResponseUtils.putJsonResponse(response, BaseUtils.succsessObjTimeRespond(records));
        } else {
            ResponseUtils.putJsonResponse(response, BaseUtils.errorrRespond("获取数据错误"));
        }
    }
}
